[Wang Yihe] iP#243
Conversation
|
[Wang Yihe] iP |
| throw new DukeException("Missing component: due date"); | ||
| } | ||
| String time = deadlineArr[1]; | ||
| if (isDateFormat(time, "yyyy-mm-dd") || isDateFormat(time, "yyyy-m-dd") || isDateFormat(time, "yyyy-mm-d") || isDateFormat(time, "yyyy-m-d")) { |
There was a problem hiding this comment.
Perhaps might want to add more spaces in front to indent this method to fit with the Java coding convention.
|
|
||
| package duke.ui; | ||
|
|
||
| import duke.task.*; |
There was a problem hiding this comment.
It might be a better idea to import relevant files from the task folder instead of importing all?
| printLine(); | ||
| printMessage("Here are the matching tasks in your list"); | ||
| for (int i = 0; i < task.size(); i++) { | ||
| int index = i + 1; |
There was a problem hiding this comment.
I like how you remember to add spaces around i + 1;
| String[] input = temp.split(" ", 2); | ||
| Command command = getUserInputType(input[0]); | ||
| switch (command) { | ||
| case DEADLINE: |
There was a problem hiding this comment.
"The explicit //Fallthrough comment should be included whenever there is a case statement without a break statement.", quoted from Java coding convection.
|
|
||
| import duke.ui.Ui; | ||
| import duke.exception.DukeException; | ||
| import duke.task.*; |
There was a problem hiding this comment.
Although all the three classes in task package are used, perhaps listing them out explicitly will comply with the coding standard better? 🤔
|
|
||
| public void add(String[] userInput, Ui ui) throws DukeException { | ||
| switch (userInput[0]) { | ||
| case "todo": |
There was a problem hiding this comment.
According to our coding standard, perhaps there should not be spaces before each "case"? 🤔
ljhgabe
left a comment
There was a problem hiding this comment.
Great work! LGTM except for some naming issues.
| } | ||
|
|
||
| @Override | ||
| public String savedFormat() { |
There was a problem hiding this comment.
Perhaps the naming here could be even more straightforward? e.g. formatInFile.
| task.add(t); | ||
| } | ||
|
|
||
| public static boolean isDateFormat(String date) { |
| return true; | ||
| } | ||
|
|
||
| public void parseTask(TaskList task, String info) throws IndexOutOfBoundsException{ |
There was a problem hiding this comment.
If it is a "TaskList", perhaps can rename the variable name to "tasks"? 🤔 (same applies to the rest methods)
| return "[ ] " + this.description; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Perhaps more Javadoc comments could be included? 🤔
User Guide 📣
No description provided.